document.querySelector('#login').onclick = function (event) {
    event.preventDefault();
    let username = $('#username').val().trim()
    let password = $('#password').val().trim()
    ajax("/admin/user/login", function (data) {
        if (data.code == 200) {
            console.log(data.token)
            localStorage.setItem('token', data.token)
            location.href = 'index.html'
        }
    }, 'post', `username=${username}&password=${password}`)
}